Range.classPrototype.constructor

Instance of

Function

Parameters

start /*Number*/, stop /*Number*/, [step /*Number*/]

Return value

/*Range*/

Description

Creates new range object.

Example

function printRange(r) {
    console.write(r.start(), " ", r.stop(), " ", r.step()).newLine()
}

printRange(0..5)
printRange(5..0)
printRange(5..0..-2)

printRange(Range(0, 5))
printRange(Range(5, 0))
printRange(Range(5, 0,-2))

Expected output

0 5 1
5 0 -1
5 0 -2
0 5 1
5 0 -1
5 0 -2